package dS.ProjectGPS.LeicaOWI;

import javax.microedition.lcdui.*;

public class FormOwiDYN extends Form implements FormOwi {

  OWIAgent owiAgent = null;

  ChoiceGroup staticKinematic = new ChoiceGroup("", ChoiceGroup.EXCLUSIVE);
  StringItem note = new StringItem("", "Note: Values cannot be changed",
                                   StringItem.PLAIN);

  public FormOwiDYN(OWIAgent o) {
    super("Current Dynamics");

    owiAgent = o;

    try {
      ndsInit();
    }
    catch (Exception ex) {
    }
  }

  public void ndsInit() throws Exception {
    append(staticKinematic);
    staticKinematic.append("Static", null);
    staticKinematic.append("Kinematic", null);
    append(note);
  }

  public void update() {
    owiAgent.query(OWI.qsDYN());

    staticKinematic.setSelectedIndex(OWI.currentDynamics - 1, true);
  }

  public void save() {
    // Does nothing - DYN can't set
  }
}
